package homework42;

public class TerminalExpression extends AbstractExpression {
    private String direc ;

    public TerminalExpression(String direc){
        this.direc = direc;
    }
    @Override
    public String interpret() {
       if(direc.equalsIgnoreCase("and")){//运算为0
           return " 0";
       }else if (direc.equalsIgnoreCase("or")){//运算为1
           return "1";
       }
       return "无法计算";
    }
}
